<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./libs/vue3.js"></script>
    <script src="./libs/axios.min.js"></script>
    <style>
        .home {
            background-color: lightgreen;
            padding: 10px;
            min-height: 100px;
        }
    </style>
</head>

<body>
    <div id="app">
        <home />
    </div>
</body>
<script>
    // 创建vue应用实例
    const app=Vue.createApp({

    });
    // 注册全局属性
    app.config.globalProperties.$axios=axios;
    // 注册全局组件
    app.component('home', {
        template: `
            <div class="home">
                <h1>home组件</h1>
            </div>
        `,
        created(){
            // console.log(this.$axios);
            this.$axios.get('https://cnodejs.org/api/v1/topics').then(res=>{
                console.log(res);
            });
        }
    });

    // 挂载vue实例
    app.mount('#app');

    
</script>

</html>